package core.service.crud;

import java.io.Serializable;
import java.util.List;

import core.base.page.Page;
import core.base.page.PageRequest;
import core.dao.mybatis.GenericDao;
import core.dao.mybatis.QueryResult;

public class SimpleGenericServiceImpl<T, I extends Serializable, Q> extends SimpleCrudServiceImpl<T, I> implements GenericService<T, I, Q> {

	private GenericDao<T, I, Q> dao;

	public List<T> query(Q cond, long first, long max) {
		return dao.query(cond, first, max);
	}

	public QueryResult<T> queryForResult(Q cond, long first, long max) {
		return dao.queryForResult(cond, first, max);
	}

	public Page queryForPage(Q cond, PageRequest pageReq) {
		return null;
	}

	public T getFirst(Q cond) {
		return dao.getFirst(cond);
	}

	public GenericDao<T, I, Q> getDao() {
		return dao;
	}

	public void setDao(GenericDao<T, I, Q> dao) {
		super.setDao(dao);
		this.dao = dao;
	}

}
